home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / pdselect / awnp / awnp-docs / modify.doc < prev    next >
Text File  |  2000-02-16  |  8KB  |  215 lines

  1. Modifying the GUI Window and its gadgets
  2. =========================================
  3.  
  4. All modify commands are replied to with either 'ok' or error. If more than one gadget parameter is changed by the modify command the reply can be 'ok ok ...' .  A reply of a blank line means the modify command was not understood and was ignored.
  5.  
  6. See the documentation for each gadget type for information on modifying that type of gadget type.
  7.  
  8. Modify commands that change gadget parameters begin with 'id GID' Gadgets are modified with the following  line format
  9.  
  10. 'id GID parameter1[=value] parameter2[=value] parameter3[=value] ...
  11.  
  12. example 'id 2 gadgettext="new text" disable=1'
  13.  
  14. The parameters allowed depend on the type of gadget that GID refers to.
  15.  
  16. NOTE: When modifying gadgets on a clicktab page, you should add the page parameter to the modify line.
  17.  
  18. Modify Parameters for all gadgets
  19. (except menu, arexxhost, textattr)
  20. ------------------------------
  21. address
  22.  
  23. Read the address of object asociated with the GID and information about the gadget type. This modify command MUST be ' id GID address' and returns 'ADDRESS GADGETTYPE'
  24.  
  25. An address of 0 means no object is asociated with the GID.
  26.  
  27. page="GID"
  28.  
  29.  Specify the clicktab gadget that controls the page containing the gadget to be modified. Most gadgets seem to modify fine without this being set, but it must be used for string gadgets. It should probably be used for all gadgets on clicktab pages to ensure future compatability.
  30. NOTE: you supply the Gadget ID of the clicktab, NOT the number of the page inside the clicktab.
  31.  
  32. set
  33.  
  34.  'Set' sets gadget parameters from the supplied tag list. Both 'set' and 'tags' must be used to do this.
  35.  
  36. tags="tags|data[|tag|data...]|0
  37.  
  38. A list of tag and value pairs in HEX. Do not forget the trailing null !
  39.  
  40. Get="hexvalue"
  41.  
  42. This special modify command lets you read a value associated with a gadget The pipe replies with 'ok value' when successful, a blank line if it fails.
  43.  
  44. example 'id 3 get xxxxxxxx'
  45.  
  46. This reads the selected color in a palette gadget (whose GID is 3).
  47.  
  48.  
  49. Read Gadget modify instruction
  50. ------------------------------
  51.  
  52. 'id GID read'
  53.  
  54.  
  55.  Read must not be used with other parameters besides GID.
  56. 'id GID read'
  57.  Read the gadget specified by GID. The pipe returns the same information as when a user hits a gadget but without the leading 'gadget gid'. In the case of GID=0 read returns the windows 'left top width height' settings.
  58.  
  59. Gadget interconnection modify
  60. -----------------------------
  61. This function may only be useful to programmers already familiar with interconnection who have registered CA documentation.
  62.  
  63. Target="gadget_ID"  (tar=)
  64.  
  65. The gadget to be interconnected with.
  66.  
  67. tags="tagsource|tagdest[|tagsource|tagdest..]|0
  68.  
  69. The list of tags for interconnection in HEX. Tags must be in pairs, and do not forget the trailing null!
  70.  
  71. example. 'id 3 target 2  tags="5001005|5001005|0" '
  72.  
  73. Selections made on chooser gadget 3 are connected to chooser
  74. gadget 2.
  75.  
  76.  
  77. Modify Control instructions
  78. ----------------------------
  79.  
  80. Some modify commands do not actually modify any gadgets.
  81.  
  82. mouse
  83.  
  84.  Get the position of the pointer. This returns the both the position relative to the window
  85. and relative to the screen.
  86.  
  87. 'windowX windowY screenX screenY'
  88.  
  89. Help="num"
  90.  
  91. If num =0 turn help events off, if num!=0 then turn help events on.
  92.  
  93. pointer
  94.  
  95. Set the pointer for the window, if pointerdata is not specified set the
  96. pointer to default pointer. I pointer data is given see below.
  97.  
  98. pointerdata="height|width|hotx|hoty|data1|data2|..."  (pd=)
  99.  
  100.  Pointer data is the definition for a pointer. For more information see the intuition call SetPointer(). Pointerdata="" is a special case setting the pointer to a null (invisable) pointer.
  101.  
  102. specialchar="character" (sc=)
  103.  
  104.  'Character' is a single character that replaces '|', in use as a seperator inside parameters like chooserlabels, tags, penmapdata, ...
  105.  
  106. Quiet  (q)
  107.  
  108.  Tell the pipe not to reply to the modify commands. This is actually a toggle switch turning replies off and on. SOME modify commands are ALWAYS replied to. (addnode and getfile
  109. selected 0|1)
  110.  
  111. refresh (ref)
  112.  
  113.  Refresh the gadget referenced by GID. The refresh command can be combined with any other modify command and is always executed last. GID=0 will refresh the windows root layout, this is the best way to refresh all gadgets.
  114.  
  115.  Refresh without a GID specified will refresh the entire window, usually it is better to refresh the root class as described above.
  116.  
  117. close
  118.  
  119.  Close the CA window. Dispose of window and end CApipe.
  120.  
  121. tick=number
  122.  
  123.  End the modify conversation, Reply with a tick event after number/100 seconds.
  124.  
  125. Continue (con)
  126.  
  127.  End the modify conversation.
  128.  
  129. Modifyoff (m)
  130.  
  131.  End the modify conversation AND turn modify off. (do not start any new modify conversations). Note there will be no way to turn modify back on.
  132.  
  133. Bubble Help
  134. ------------
  135.  
  136. Each GUI can show one buble help window at a time.
  137.  
  138. bubble top=numx left=numy gt="Help Text"
  139.  
  140. This opens a bubble showing the help text. Top and left are mouse location for the help (as sent to you in the help event you are responding to). Any previous help window will be closed.
  141.  
  142. 'bubble' sent with no parameters will close the bubble with out opening a new one.
  143.  
  144. Image Functions
  145. ----------------
  146.  
  147. FreeImage="num"  fi=
  148.  
  149. if num=-1 Dispose of a previously defined image without using it. Else free the root bitmap image in buffer num. Be careful not to do this while images still exist that reference this root bitmap.
  150.  
  151. Draw="num" top="num" left="num"
  152.  
  153. Draw an image into the gui. Num is the number of the predefined image to be
  154. drawn. You MUST set 'top' and 'left' and can also set
  155.  
  156.  nozz
  157.  
  158. Top and left are relative th the whole window rather than the inner panel.
  159.  
  160.  noclip
  161.  
  162. Allow images to oerwrite the windows boarder.
  163.  
  164. The image number relates to images you have created but not used in your GUI.
  165. For example...
  166.  
  167. You create an image 'bitmap fn="cat.gif"'  it is image 0.
  168. You create another image 'bitmap fn="dog.gif"' it is image 1.
  169. You create another image 'bitmap fn="bird.gif"' it is image 2.
  170.  
  171. You create a BUTTON using the last image created 'button useimage', the
  172. button used the bird image so it is no longer in the image list.
  173.  
  174. You create another image 'bitmap fn="frog.gif"' it is image 2.
  175.  
  176. You now have 3 images available to draw
  177.  
  178. 0 cat
  179. 1 dog
  180. 2 frog
  181.  
  182. Drawing images DOES NOT remove images from the image list. Incorporating
  183. images directly in your GUI DOES remove images from the image list. The image
  184. number is NOT related to the buffer number in the bitmap image parameters.
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191. GID 0
  192. -------
  193.  
  194. GID 0 is used to specify the GUI window itself. It can be used to control certain aspects of the window. (see window docs)
  195.  
  196. Defining new gadgets during modify
  197. ------------------------------------
  198.  
  199. define
  200.  
  201.  This causes the current line to be used as a Gadget definition statement rather than modify. You can add or replace gadgets in the already opened window. You may need to send a refresh modify command to make the changes visible.
  202.  
  203. replace="GID"
  204.  
  205.  The newly defined gadget replaces the existing gadget specified by GID. The pipe tries to free the resources used by the previous gadget right away, but some memory is not freed until the pipe is closed.
  206.  
  207.  WHEN USING REPLACE DO NOT ASSUME WHAT THE RESULTING GID OF THE NEW GADGET WILL BE. The usual sequence of allocated gadget ID's is not followed. Replacing a layout group frees all gadgets in the group as well as the layout itself. Replacing a listbrowser frees its nodes.
  208.  
  209.  You MUST keep track and not try to access gadgets that no longer exist.
  210.  
  211. Generally it is better to close the window and open a new one rather than using replace or define. On the other hand some pretty neat thing can be done using them. ;-D
  212.  
  213. NOTE: There is a problem when replacing a gadget with a Listbrowser gadget (or a layout containing one). I advise NOT to do this. Open a new window instead.
  214.  
  215.